import React, { Component } from 'react'
// import RouterView from '../../router/index'
import { NavLink, Switch, Route,Redirect } from "react-router-dom"
import "../../assets/css/indexInner.css"
const Home = React.lazy(() => import("../../views/Home/Home"))
const Cate = React.lazy(() => import("../../views/Cate/Cate"))
const Cart = React.lazy(() => import("../../views/Cart/Cart"))
const Mine = React.lazy(() => import("../../views/Mine/Mine"))

// import Home from '../../views/Home/Home'
export default class Index extends Component {
    render() {
        return (
            <React.Suspense fallback={<div>loading...</div>}>
                <div className="index">
                    {/* <RouterView></RouterView> */}
                    <footer style={{ width: "100vw" }}>
                        <NavLink activeClassName="active" to="/index/home"><i className="iconfont icon-shangdian"></i>首页</NavLink>
                        <NavLink activeClassName="active" to="/index/cate"><i className="iconfont icon-iconfl"></i>分类</NavLink>
                        <NavLink activeClassName="active" to="/index/cart"><i className="iconfont icon-xiazai1"></i>购物车</NavLink>
                        <NavLink activeClassName="active" to="/index/mine"><i className="iconfont icon-guanliyuan"></i>我的</NavLink>
                        {/* <NavLink activeClassName="active" to="order">订单</NavLink>
                   <NavLink activeClassName="active" to="mine">我的</NavLink> */}
                    </footer>
                    <Switch>
                        <Route path="/index/home" exact strict component={Home}></Route>
                        <Route path="/index/cate" exact strict component={Cate}></Route>
                        <Route path="/index/cart" exact strict component={Cart}></Route>
                        <Route path="/index/mine" exact strict component={Mine}></Route>
                        <Redirect path="/" to="/index/home"></Redirect>
                    </Switch>
                </div>
            </React.Suspense>


        )
    }
}
